<template v-if="$model && $model.host">

  <kv>
    <template #k>
      <div class="k">Harbor, 协议
        <el-switch v-model="$model.isHttps"/>
        <remark>
          <div>1. 用于 docker/docker-registry 镜像的服务名前缀，如：harbor:8788</div>
          <div>2. harbor 仓库必须有以下基础镜像： java,vue,node, tools</div>
        </remark>
      </div>
    </template>
    <el-input v-model="$model.host" chk="?reg:^(?!http)" chk-msg="不能以 http 开头">
      <template #prefix>{{ $model.isHttps ? "https://" : "http://" }}</template>
    </el-input>
  </kv>
  <kv label="用户名,密码">
    <div style=" display: flex;justify-content: space-between;">
      <el-input v-model="$model.userName"/>
      <el-input v-model="$model.password"/>
    </div>
  </kv>

  <kv>
    <template #k>
      <div class="k">bash-ops
        <remark>
<pre>
FROM debian:11.2
MAINTAINER "nancal"
RUN echo "Asia/Shanghai" > /etc/timezone && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && date && mkdir -p /app/lib

RUN  > /etc/apt/sources.list cat && echo "deb http://mirrors.aliyun.com/debian/ bullseye main non-free contrib" >> /etc/apt/sources.list \
&& echo deb-src http://mirrors.aliyun.com/debian/ bullseye main non-free contrib >> /etc/apt/sources.list \
&& echo deb http://mirrors.aliyun.com/debian-security/ bullseye-security main  >> /etc/apt/sources.list \
&& echo deb-src http://mirrors.aliyun.com/debian-security/ bullseye-security main >> /etc/apt/sources.list \
&& echo deb http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib >> /etc/apt/sources.list \
&& echo deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib >> /etc/apt/sources.list \
&& echo deb http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib >> /etc/apt/sources.list \
&& echo deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib >> /etc/apt/sources.list \
&& apt-get update && apt-get install -y curl wget tree git unzip dos2unix

---
docker build -t ops-bash .
</pre>
        </remark>
      </div>
    </template>
    <el-input v-model="$model.bashImageName" placeholder="ops-bash"></el-input>
  </kv>
  <kv label="nginx镜像">
    <el-input v-model="$model.nginxImageName" placeholder="nginx"/>
  </kv>
</template>

<script setup>
/**
 * Created by CodeGenerator  at 2022-04-29 17:00:15
 */


defineOptions({
  name: "harbor-server",
  inheritAttrs: true,
});

//定义 vue2的this,当前组件
const $self = getCurrentInstance();

//定义 $attrs
const $attrs = useAttrs();


const $props = defineProps({
  id: {type: String},
  action: {type: String},
  title: {type: String}
});

const action_name = $computed(() => {
  return {add: "添加", edit: "修改"}[$props.action]
});
const $model = defineModel({type: Object});


const list = ref();

//定义事件
const $emit = defineEmits(["update:modelValue", "loaded"]);


</script>
